<?php

namespace plugin\muadmin\app\admin\controller;

use plugin\muadmin\app\common\base\BaseAdminController;

class Test extends BaseAdminController
{
    public function index()
    {
        if($this->request->isAjax()){
            list($where, $sort, $order, $page, $limit) = $this->buildParameter();
            $list = [
                [
                    'id'=>1,
                    'name'=>'测试1',
                    'url'=>'/app/muadmin/image/11.png',
                    'urls'=>['/app/muadmin/image/11.png'],
                    'mytest'=>'1',
                    "status"=>1,
                    'createtime'=>"2027-04-04 12:33:33",
                ],
                [
                    'id'=>2,
                    'name'=>'测试2',
                    'url'=>'/app/muadmin/image/11.png',
                    'urls'=>['/app/muadmin/image/11.png'],
                    'mytest'=>'2',
                    'status'=>0,
                    'createtime'=>"1751747118",
                ],
            ];
            $res = ['total'=>1000,'rows'=>$list,'where'=>[
                'sort'=>$sort,
                'order'=>$order,
                'page'=>$page,
                'limit'=>$limit,
            ]];
            return $this->success('ok',$res);
        }
        return $this->fetch();
    }
    public function add()
    {
        if($this->request->isAjax()){
            $row = $this->param('row');
            return $this->success('ok',$row);
        }
        return $this->fetch();
    }
    public function edit($ids=null)
    {
        if($this->request->isAjax()){
            $data = $this->param('row');
            return $this->success('ok',$data);
        }
        return $this->fetch();
    }
    public function del($ids=null)
    {
        return $this->success('删除成功');
    }
    public function mytest()
    {
        return $this->success('ok');
    }
    public function testopen()
    {
        return $this->fetch();
    }
    public function multi($ids=null)
    {
        return $this->success('ok',['ids'=>$ids]);
    }
}